/*
 * @Description:
 * @Author: xunzhaotech
 * @Email: luyb@xunzhaotech.com
 * @QQ: 1525572900
 * @Date: 2025-04-10 09:49:49
 * @LastEditTime: 2025-05-30 15:29:05
 * @LastEditors: xunzhaotech
 */
import request from '@/config/axios'

// ERP 能耗车间 VO
export interface EnergyWorkshopVO {
  id: number // 车间编号
  name: string // 车间名字
  sort: number // 排序
}

// ERP 能耗车间 API
export const EnergyWorkshopApi = {
  // 查询ERP 能耗车间分页
  getEnergyWorkshopPage: async (params: any) => {
    return await request.get({ url: `/erp/energy-workshop/page`, params })
  },

  // 查询ERP 能耗车间详情
  getEnergyWorkshop: async (id: number) => {
    return await request.get({ url: `/erp/energy-workshop/get?id=` + id })
  },

  // 新增ERP 能耗车间
  createEnergyWorkshop: async (data: EnergyWorkshopVO) => {
    return await request.post({ url: `/erp/energy-workshop/create`, data })
  },

  // 修改ERP 能耗车间
  updateEnergyWorkshop: async (data: EnergyWorkshopVO) => {
    return await request.put({ url: `/erp/energy-workshop/update`, data })
  },

  // 删除ERP 能耗车间
  deleteEnergyWorkshop: async (id: number) => {
    return await request.delete({ url: `/erp/energy-workshop/delete?id=` + id })
  },

  // 导出ERP 能耗车间 Excel
  exportEnergyWorkshop: async (params) => {
    return await request.download({ url: `/erp/energy-workshop/export-excel`, params })
  }
}
